home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / DevTools / ClassEditor.0.4 / Source / RZBrowserCell.subproj / RZBrowserCell.h < prev    next >
Encoding:
Text File  |  1995-04-04  |  2.3 KB  |  85 lines

  1. /*
  2.  * RZBrowserCell
  3.  *
  4.  * A subclass of BrowserCell supporting fixed and variable position tabs,
  5.  * multi-font text and inline graphics.
  6.  *
  7.  * Here is an example of setting up a Browser to use a RZBrowserCell:
  8.  *
  9.  *     // create a prototype cell for the browser
  10.  *     id cellPrototype = [[RZBrowserCell alloc] init];
  11.  *     
  12.  *     // initialize the tab stops 
  13.  *     // fixed tab at 10 pixels 
  14.  *     [cellPrototype addFixedTab:10.0];
  15.  *     
  16.  *     // proportional tab at 20% with min at 30 and max at 600 pixels 
  17.  *     [cellPrototype addProportionalTab:0.2 min:30 max:600];
  18.  *     
  19.  *     // fixed tab 60 pixels from right side 
  20.  *     [cellPrototype addFixedTab:-60.0];
  21.  *     
  22.  *     // make sure to set the prototype before we've loaded any columns
  23.  *     [browser setCellPrototype:cellPrototype];
  24.  *     [browser loadColumnZero];
  25.  *     [[browser window] makeKeyAndOrderFront:self];
  26.  *
  27.  *
  28.  * You may freely copy, distribute and reuse the code in this example.
  29.  * This code is provided AS IS without warranty of any kind, expressed 
  30.  * or implied, as to its fitness for any particular use.
  31.  *
  32.  * Copyright 1995 Ralph Zazula (rzazula@next.com).  All Rights Reserved.
  33.  *
  34.  */
  35.  
  36. #import <appkit/NXBrowserCell.h>
  37.  
  38. #define FONT_NORMAL 0
  39. #define FONT_BOLD 1
  40. #define FONT_ITALIC 2
  41. #define FONT_BOLD_ITALIC 3
  42.  
  43. #define FONT_BLACK 0
  44. #define FONT_DKGRAY 1
  45. #define FONT_LTGRAY 2
  46. #define FONT_WHITE 3
  47.  
  48. @interface RZBrowserCell : NXBrowserCell
  49. {
  50.     NXCoord    ascender, descender, lineHeight;
  51.     id tabStops, textTokens;
  52. }
  53.  
  54. - free;
  55. - setFont:fontObj;
  56. - calcCellSize:(NXSize *)theSize inRect:(const NXRect *)aRect;
  57. - drawInside:(const NXRect *)cellFrame inView:controlView;
  58. - highlight:(const NXRect *)cellFrame inView:controlView lit:(BOOL)flag;
  59.  
  60. /*** manipulating tabs ***/
  61.  
  62. - addProportionalTab:(float)position;
  63. - addProportionalTab:(float)position min:(float)minPos max:(float)maxPos;
  64. - addFixedTab:(float)position;
  65. - clearTabs;
  66.  
  67. /*** manipulating text tokens ***/
  68.  
  69. - setText:(const char *)format at:(unsigned)index font:(char)font color:(char)color, ...;
  70. - setText:(const char *)format at:(unsigned)index, ...;
  71. - setText:(const char *)format at:(unsigned)index font:(char)font, ...;
  72. - setText:(const char *)format at:(unsigned)index color:(char)color, ...;
  73. - clearText;
  74.  
  75. /*** manipulating icons ***/
  76.  
  77. - setImageNamed:(const char *)name at:(unsigned)index;
  78.  
  79. /*** archiving ***/
  80.  
  81. - write:(NXTypedStream *)ts;
  82. - read:(NXTypedStream *)ts;
  83.  
  84. @end
  85.